package bairui.international.controller.ticket.offset;

import com.sh_lianjing.spring.web.controller.enhance.module.*;
import com.sh_lianjing.spring.web.controller.enhance.module.body.*;
import com.sh_lianjing.spring.web.controller.enhance.output.bean.*;
import bairui.international.controller.ticket.offset.C_Ticket_Offset_Submit_Get;
import bairui.international.controller.ticket.offset.C_Ticket_Offset_NoPass_AddAccess;
import bairui.international.controller.ticket.offset.C_Ticket_Offset_Pass_Get;
import bairui.international.controller.ticket.offset.C_Ticket_Offset_Edit_EditAccess;
import bairui.international.controller.ticket.offset.C_Ticket_Offset_Generate_Get;

/**
 *
 * Module_Info
 *
 */
class Module_Info{

	
	/**
	 * 信息模块
	 */
	public Module module(
		Module_Info_Head_OutputModel beanHead, 
		Module_Info_OutputModel bean, 
		C_Ticket_Offset_Submit_Get.Get.Operate c_Ticket_Offset_Submit_Get_Get_Operate
	,	C_Ticket_Offset_NoPass_AddAccess.AddAccess.Operate c_Ticket_Offset_NoPass_AddAccess_AddAccess_Operate
	,	C_Ticket_Offset_Pass_Get.Get.Operate c_Ticket_Offset_Pass_Get_Get_Operate
	,	C_Ticket_Offset_Edit_EditAccess.EditAccess.Operate c_Ticket_Offset_Edit_EditAccess_EditAccess_Operate
	,	C_Ticket_Offset_Generate_Get.Get.Operate c_Ticket_Offset_Generate_Get_Get_Operate
	){
		return
			new Module(
					new ModuleHead(beanHead, Module_Head_OutputData.info())
						.addOperate(
							c_Ticket_Offset_Submit_Get_Get_Operate
								.defaultComment("提交")
						)
						.addOperate(
							c_Ticket_Offset_NoPass_AddAccess_AddAccess_Operate
								.defaultComment("审核不通过")
								.defaultTarget(com.sh_lianjing.spring.web.controller.base.operate.OperateTarget.Popup)
						)
						.addOperate(
							c_Ticket_Offset_Pass_Get_Get_Operate
								.defaultComment("审核通过")
						)
						.addOperate(
							c_Ticket_Offset_Edit_EditAccess_EditAccess_Operate
								.defaultComment("编辑")
								.defaultTarget(com.sh_lianjing.spring.web.controller.base.operate.OperateTarget.Popup)
						)
						.addOperate(
							c_Ticket_Offset_Generate_Get_Get_Operate
								.defaultComment("生成电子券")
						)
					, 
					new InfoModuleBody(
								bean
							,
							new OutputBeanGroup(
									OutputWay.Vertical, 
									OutputData.info()
								)
						)
				);
	}
	
	/**
	 * 输出信息
	 */
	private static class OutputData {
	
		private static final OutputBean[] info() {
			OutputData outputData = new OutputData();
			return new OutputBean[]{
						outputData.getId(),
						outputData.getNumber(),
						outputData.getName(),
						outputData.getPrice(),
						outputData.getType(),
						outputData.getCount(),
						outputData.getOneuseFlag(),
						outputData.getGiveFlag(),
						outputData.getApplyDate(),
						outputData.getState(),
						outputData.getRequester(),
						outputData.getExpiryDate(),
						outputData.getComment(),
				};
		}
	
		OutputBean getId(){
			return new OutputBean("id", "", true, DataDisplay.Hide, DataType.Long, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getNumber(){
			return new OutputBean("number", "编号", true, DataDisplay.Show, DataType.String, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getName(){
			return new OutputBean("name", "标题", true, DataDisplay.Show, DataType.String, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getPrice(){
			return new OutputBean("price", "面值", true, DataDisplay.Show, DataType.Double, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getType(){
			return new OutputBean("type", "类型", true, DataDisplay.Show, DataType.Enum, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getCount(){
			return new OutputBean("count", "数量", true, DataDisplay.Show, DataType.Long, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getOneuseFlag(){
			return new OutputBean("oneuseFlag", "是否一次性", true, DataDisplay.Show, DataType.Boolean, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getGiveFlag(){
			return new OutputBean("giveFlag", "是否可赠送", true, DataDisplay.Show, DataType.Boolean, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getApplyDate(){
			return new OutputBean("applyDate", "申请时间", true, DataDisplay.Show, DataType.Date, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getState(){
			return new OutputBean("state", "状态", true, DataDisplay.Show, DataType.Enum, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getRequester(){
			return new OutputBean("requester", "申请人", true, DataDisplay.Show, DataType.String, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getExpiryDate(){
			return new OutputBean("expiryDate", "有效期", true, DataDisplay.Show, DataType.Date, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
		OutputBean getComment(){
			return new OutputBean("comment", "备注", true, DataDisplay.Show, DataType.String, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
		}
	}
	
	
	
	
	/**
	 * 输出模型
	 */
		private static class Module_Head_OutputData {
		
			private static final OutputBean[] info() {
				Module_Head_OutputData outputData = new Module_Head_OutputData();
				return new OutputBean[]{
							outputData.getState(),
							outputData.getNumber(),
					};
			}
		
			OutputBean getState(){
				return new OutputBean("state", "状态", true, DataDisplay.Show, DataType.Enum, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
			}
			OutputBean getNumber(){
				return new OutputBean("number", "编号", true, DataDisplay.Show, DataType.String, new OutputType[]{OutputType.Ajax, OutputType.Excel, }, "yy/MM/dd HH:mm:ss");
			}
		}
		
		
	
	

}
